package API.DAY2;

public class MachesDemo {
    public static void main(String[] args) {
        /*
         邮箱的正则表达式：
         [a-zA-Z0-9_]+@[a-zA-Z0-9]+(\.[a-zA-Z]+)+
         */
        String email = "123456@qq.com";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";

        boolean x = email.matches(regex);
        if(x){
            System.out.println("正确");
        }else {
            System.out.println("错误");
        }
    }
}
